﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form3 : Form
    {
        OpenFileDialog openFileDialog1;
        public Form3()
        {
            InitializeComponent();
            textBox2.Text = Properties.Settings.Default.ServerIp;
            textBox3.Text = Properties.Settings.Default.ServerPort;
            textBox4.Text = Properties.Settings.Default.EncryptionCode;
            textBox5.Text = Properties.Settings.Default.NetworkName;
            textBox6.Text = Properties.Settings.Default.ClientIp;
            textBox7.Text = Properties.Settings.Default.ClientSubnetMask;
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
        }

        private void Form3_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.UserClosing)
            {
                e.Cancel = true;
                this.Hide();
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            openFileDialog1 = new OpenFileDialog();
            openFileDialog1.Filter = "Edge Files|edge.exe";
            openFileDialog1.Title = "Select a Cursor File";
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                this.textBox1.Text = openFileDialog1.FileName;
            }

        }

        public string get_setting() {
            return textBox1.Text;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.ServerIp = textBox2.Text;
            Properties.Settings.Default.ServerPort = textBox3.Text;
            Properties.Settings.Default.EncryptionCode = textBox4.Text;
            Properties.Settings.Default.NetworkName = textBox5.Text;
            Properties.Settings.Default.ClientIp = textBox6.Text;
            Properties.Settings.Default.ClientSubnetMask = textBox7.Text;
            this.Hide();
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
        }

        private void label4_Click(object sender, EventArgs e)
        {

        }

        private void maskedTextBox1_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
        {

        }

        private void label6_Click(object sender, EventArgs e)
        {

        }

        private void Form3_Load(object sender, EventArgs e)
        {

        }
    }
}
